﻿@{
    ViewBag.Title = (Model.Id > 0 ? "修改" : "添加") + "小类";
    Layout = "~/Areas/Admin/Views/Shared/_RightLayout.cshtml";
}
<script src="@Url.Content("~/scripts/ckfinder/ckfinder.js")" type="text/javascript"></script>
<script type="text/javascript">
    function BrowseServer(inputId) {
        var finder = new CKFinder();
        finder.basePath = '/scripts/ckfinder/';
        finder.selectActionFunction = SetFileField;
        finder.selectActionData = inputId;
        finder.startupPath = 'Images:images';
        finder.resourceType = 'Images';
        finder.popup();
    }
    function SetFileField(fileUrl, data) {
        document.getElementById(data["selectActionData"]).value = fileUrl;
    } 
</script>
	<form id="editForm" name="editForm" method="post" action="/Admin/Subclass/Save/@if (Model.Id > 0) { Write(Model.Id.ToString()); }?classid=@Request["classid"]">
	<div id="panelBar">
		<ul class="toolBar">
			<li><input class="submit" type="submit" value="保存" /></li>
			<li><a class="back" href="javascript:void(0)"><span>返回</span></a></li>
		</ul>
	</div>
	<div id="edit">
    <input type="hidden" name="isnews" value="@(ViewBag.IsNews?"Y":"N")" />
		<ul>
            @if (!ViewBag.IsNews)
            {
            <li> 
				<span class="label">上级分类：</span>
                <span class="required">
                    <select id="parentid" name="parentid">
                        <option value="0">无</option>
                        @foreach (var item in ViewBag.ParentClasses)
                        {
                        <option value="@item.Id" @if (item.Id == Model.parentid) { Write("selected='selected'"); }>@item.Name_Zh_cn</option>
                        }
                    </select>
                </span>
			</li>
            }

            <li> 
				<span class="label">简体中文：</span>
                <span class="required">
                    <input id="Name_Zh_cn" name="Name_Zh_cn" type="text" value="@Model.Name_Zh_cn" required="required" title="请输入" /> 
                </span>
			</li>
            <li> 
				<span class="label">繁体中文：</span>
                <span>
                    <input id="Name_Zh_tw" name="Name_Zh_tw" type="text" value="@Model.Name_Zh_tw" title="请输入" /> 
                </span>
			</li>
            <li> 
				<span class="label">英文：</span>
                <span>
                    <input id="Name_En_us" name="Name_En_us" type="text" value="@Model.Name_En_us" title="请输入" /> 
                </span>
			</li> 
            <li style="display:@(ViewBag.IsNews?"none":"")"> 
				<span class="label">简体中文简介：</span>
                <span class="required">
                    <input id="summary_zh_cn" style="width:600px;" name="summary_zh_cn" type="text" value="@Model.summary_zh_cn" title="请输入" /> 
                </span>
			</li>
            <li style="display:@(ViewBag.IsNews?"none":"")"> 
				<span class="label">繁体中文简介：</span>
                <span class="required">
                    <input id="summary_zh_tw" style="width:600px;" name="summary_zh_tw" type="text" value="@Model.summary_zh_tw" title="请输入" /> 
                </span>
			</li>
            <li style="display:@(ViewBag.IsNews?"none":"")"> 
				<span class="label">英文简介：</span>
                <span class="required">
                    <input id="summary_en_us" style="width:600px;" name="summary_en_us" type="text" value="@Model.summary_en_us" title="请输入" /> 
                </span>
			</li>
            <li> 
				<span class="label">图片地址(简体中文)：</span>
                <span >
                    <input id="PicUrl_Zh_cn" name="PicUrl_Zh_cn" type="text" value="@Model.PicUrl_Zh_cn"  title="请输入" /> 
                    <input type="button" value=" 浏 览 " onclick="BrowseServer('PicUrl_Zh_cn');" />
                </span>
			</li> 
            <li> 
				<span class="label">图片地址(繁体中文)：</span>
                <span >
                    <input id="PicUrl_Zh_tw" name="PicUrl_Zh_tw" type="text" value="@Model.PicUrl_Zh_tw"  title="请输入" /> 
                    <input type="button" value=" 浏 览 " onclick="BrowseServer('PicUrl_Zh_tw');" />
                </span>
			</li> 
            <li> 
				<span class="label">图片地址(英文)：</span>
                <span >
                    <input id="PicUrl_En_us" name="PicUrl_En_us" type="text" value="@Model.PicUrl_En_us"  title="请输入" /> 
                    <input type="button" value=" 浏 览 " onclick="BrowseServer('PicUrl_En_us');" />
                </span>
			</li> 
            <li> 
				<span class="label">小类自定义地址：</span>
                <span >
                    <input id="ClassUrl" name="ClassUrl" type="text" value="@Model.ClassUrl"  title="请输入" /> 
                </span>
			</li> 
            <li> 
				<span class="label">显示顺序：</span>
                <span class="required">
                    <input id="DisplayOrder" name="DisplayOrder" type="text" value="@Model.DisplayOrder" title="请输入" /> 
                </span>
			</li>
            @*<li> 
				<span class="label">CreateBy：</span>
                <span >
                    <input id="CreateBy" name="CreateBy" type="text" value="@Model.CreateBy"  title="请输入" /> 
                </span>
			</li> 
            <li> 
				<span class="label">UpdateBy：</span>
                <span >
                    <input id="UpdateBy" name="UpdateBy" type="text" value="@Model.UpdateBy"  title="请输入" /> 
                </span>
			</li> *@
		</ul>
	</div>
	</form>
